package com.demo.apparel.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("user_address")
@Schema(name = "UserAddress", description = "用户收货地址实体")
public class UserAddress {

    @TableId(type = IdType.INPUT)  // 手动输入主键
    @Schema(description = "地址ID（主键，使用雪花算法生成）")
    private String id;

    @TableField("user_id")
    @Schema(description = "所属用户ID")
    private String userId;

    @Schema(description = "收件人姓名")
    private String receiver;

    @Schema(description = "联系电话")
    private String contact;

    @Schema(description = "省份编码")
    private String provinceCode;

    @Schema(description = "城市编码")
    private String cityCode;

    @Schema(description = "区县编码")
    private String countyCode;

    @Schema(description = "省市区全称")
    private String fullLocation;

    @Schema(description = "详细地址")
    private String address;

    @Schema(description = "邮政编码")
    private String postalCode;

    @Schema(description = "是否默认地址（0: 否，1: 是）")
    private Integer isDefault;

    @Schema(description = "地址标签，如 '家'、'公司' 等")
    private String addressTags;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createdTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updatedTime;
}
